package com.h2cloud.clone;

/**
 * @Package: com.h2cloud.clone
 * @ClassName: StudentTest
 * @Author: h2cloud
 * @CreateTime: 2021/9/28 4:39 下午
 * @Description:
 */
public class StudentTest {
    public static void main(String[] args) {
        Professor p = new Professor("wangwu", 50);
        Student s1 = new Student("zhangsan", 18, p);
        Student s2 = (Student) s1.clone();
        s2.getPro().setName("maer");
        s2.getPro().setAge(40);
        System.out.println("name=" + s1.getPro().getName()
                + ",age=" + s1.getPro().getAge());
        //name=maer,age=40
    }
}
